package com.ljx.thread.thread03;

/**
 * @author LJX
 * @Description: TODO
 * @Date: 2022/11/1 9:47
 * @Version 1.0
 */
public class TestPriority {
	public static void main(String[] args) {
		PriorityThread priorityThread1 = new PriorityThread();
		PriorityThread priorityThread12 = new PriorityThread();
		priorityThread1.setName("线程1");
		priorityThread12.setName("线程2");
		/**
		 * 设置线程的优先级，默认优先级为5
		 * 最大优先级为10，最小为1
		 */

		priorityThread1.setPriority(10);
		priorityThread12.setPriority(1);
		priorityThread1.start();
		priorityThread12.start();
	}
}

class PriorityThread extends Thread{
	@Override
	public void run() {
		System.out.println(Thread.currentThread().getName()+"~~~~~~~~~~~~~~~");

	}
}